package com.example.demo.pojo;

import lombok.Data;
import org.springframework.http.HttpStatus;

import java.net.http.HttpHeaders;

@Data
public class Result<T> {
    private Integer code;
    private String msg;
    private T data;

    public Result(Integer code,String msg,T data){
        this.code=code;
        this.msg = msg;
        this.data =data;
    }

    public static <T> Result<T> success(T data){
        return new Result(HttpStatus.OK.value(),"success",data);
    }

    public static Result success(){
        return new Result(HttpStatus.OK.value(),"success",null);
    }
}
